<?php

$i=0;
$rlt = array();

$data = array();

foreach($pager->getResults() as $vend) {

    $data[$i]["id"] = $vend->getId();
    $data[$i]["cell"] = array(
        $vend->getId(),
        $vend->getVendNo(),
        $vend->getVendName(),
        $vend->getVendFname(),
        $vend->getVendType(),
        $vend->getVendAddr(),
        $vend->getVendAddr1(),
        $vend->getVendZip(),
        $vend->getVendTel(),
        $vend->getVendContact(),
        $vend->getVendFax(),
        $vend->getVendMemo(),
        $vend->getVendOpr()->getFullName(),
        $vend->getCreatedAt(),
        $vend->getUpdatedAt()
    );

    $i++;

}

$rlt["page"] = $pager->getPage();
$rlt["total"] = $pager->getLastPage();
$rlt["records"] = $pager->count();  //总记录数
$rlt["rows"] = $data;    //记录

echo json_encode($rlt);